package cn.wolfcode.luowowo.website.web.controller;

import cn.wolfcode.luowowo.website.web.util.UploadUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;


@Controller
public class uploadController {

    @Value("${file.path}")
    private String fileBasePath;

    @RequestMapping("coverImageUpload")
    @ResponseBody
    public Object uploadImg(MultipartFile pic){
        //硬盘服务器,之前存阿里云的,阿里云好在全国有分支服务器
        System.err.println(pic);
        System.err.println(fileBasePath);
        String filename = UploadUtil.upload(pic,fileBasePath);
        return filename;
    }




}
